<template>
  <avue-crud ref="crud"
             :data="data"
             :option="option"
             @row-click="rowClick">
    <template #radio="{row}">
      <el-radio v-model="selectRow"
                :label="row.$index">-</el-radio>
    </template>
  </avue-crud>
</template>
<script>
export default {
  data () {
    return {
      selectRow: '',
      data: [{
        id: 1,
        name: '张三',
        sex: '男'
      }, {
        id: 2,
        name: '李四',
        sex: '女'
      }],
      option: {
        align: 'center',
        menuAlign: 'center',
        column: [{
          label: '',
          prop: 'radio',
          width: 60,
          hide: false
        },
        {
          label: '姓名',
          prop: 'name'
        }, {
          label: '性别',
          prop: 'sex'
        }
        ]
      },
    };
  },
  methods: {
    rowClick (row) {
      this.selectRow = row.$index
      this.$message.success('选择序号' + row.$index)
    },
  }
}
</script>